<?php
class UserListAction extends AdminAction
{
	public function __construct()
	{
		parent::__construct();
		$this->layout = 'default';
	}
	
	public function execute()
	{
		$page	= $this->getPage();
		$pageSize = 20;
		$num = $pageSize;
		$start = ($page-1) * $pageSize;
		
		$con = array();
		$userService = new UserService();
		$this->data['users'] = $userService->getList($con, 'id DESC', $start, $num);
		
		$count = $this->data['users']['count'];
		$baseUrl = C('LtUrl')->generate('User', 'List', array('p' => ':page'));
		
		$pagination = new LtPagination($pageSize);
		$this->data['pages'] = $pagination->pager($page, $count, $baseUrl);
		
		$this->data['menu'] = 'user';
	}
}
